<?php

namespace App\Common;

use Illuminate\Support\Facades\Redis;

class RedisSingleton
{

    private static $instance=null;
    private $reids;

    private function __construct(){
        $this->reids = new \Redis();
        $this->reids->connect('127.0.0.1',6379);
    }

    public static function getInstance()
    {
        if (self::$instance == null) {
            self::$instance = new RedisSingleton();
        }
        return self::$instance->reids;
    }
}
